<template>
	<view class="container">
		<view class="list-cell b-b m-t" @click="navto('userinfo')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">个人资料</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell b-b m-t" @click="navto('security')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">安全中心</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell b-b m-t" @click="$navTo('/pages/groupmenu/joinshop')" hover-class="cell-hover"
			:hover-stay-time="50">
			<text class="cell-tit">店铺确认</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<!-- <view class="list-cell b-b m-t" @click="$navTo('/pages/user/gridyuan')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">网格元申请</text>
			<text class="cell-more yticon icon-you"></text>
		</view> -->
		<view class="list-cell b-b m-t" @click="navto('/pages/other/feedback')" hover-class="cell-hover"
			:hover-stay-time="50">
			<text class="cell-tit">问题反馈</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<!-- #ifdef MP-WEIXIN -->
		<view class="list-cell b-b m-t" @click="navto('/pages/other/aboutus')" hover-class="cell-hover"
			:hover-stay-time="50">
			<text class="cell-tit">关于我们</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<!-- #endif -->
		<view class="list-cell b-b m-t" @click="navto('/pages/user/changeRecommender')" hover-class="cell-hover"
			:hover-stay-time="50">
			<text class="cell-tit">变更推荐人</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell b-b m-t">
			<text class="cell-tit">版本号</text>
			<text class="cell-more">{{$store.state.version}}</text>
		</view>
		<view class="list-cell log-out-btn" @click="toLogout">
			<text class="cell-tit">退出登录</text>
		</view>
		<view class="privacy">阅读<text style="color: #4399fc;"
				@click="navto('https://bpapi.jinghushi.com/agreement.html')">“用户注册协议”</text>与<text
				style="color: #4399fc;" @click="navto('https://bpapi.jinghushi.com/policy.html')">“隐私政策”</text></view>

		<!-- <view class="j_copyright">
			<text>Copyright © 2020 - 2020</text>
			<text>新密市正鑫化妆品商行  版权所有 </text>
		</view> -->
	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex';
	export default {
		methods: {
			...mapMutations(['logout']),

			navto(url) {
				if (url != "#" && url != "") {
					if (url.indexOf('http') == -1) {
						uni.navigateTo({
							url: url
						})
					} else {
						// #ifdef APP-PLUS || MP-WEIXIN || MP-ALIPAY
						uni.navigateTo({
							url: "/pages/web/web-view?url=" + url
						})
						// #endif
						// #ifdef H5
						window.location.href = url
						// #endif
					}
				}
			},
			//退出登录
			toLogout() {
				var that = this;
				uni.showModal({
					content: '确定要退出登录么',
					success: (e) => {
						if (e.confirm) {
							that.$axios('logout/doout', "POST", 'member', {

							}, that.$url.state.Edition).then(res => {
								if (res.data.code == 200) {
									var Ver = uni.getStorageSync('ver');
									var Lng = uni.getStorageSync('x');
									var Lat = uni.getStorageSync('y');
									uni.clearStorage();
									uni.setStorageSync('ver', Ver);
									uni.setStorageSync('Jh_recotabshops', 1)
									uni.setStorageSync('x', Lng);
									uni.setStorageSync('y', Lat);
									uni.switchTab({
										url: '/pages/mallHome/selfMall',
										success() {
											uni.setStorageSync('yinsi', 1);
										}
									});
								}
							}, (error) => {

							})
						}
					}
				});
			},
			//switch
			switchChange(e) {
				let statusTip = e.detail.value ? '打开' : '关闭';
				this.$api.msg(`${statusTip}消息推送`);
			},

		}
	}
</script>

<style lang='scss'>
	page {
		background: $page-color-base;
	}

	.privacy {
		color: $font-color-base;
		padding-top: 16upx;
		font-size: 24upx;
		text-align: center;
	}

	.list-cell {
		display: flex;
		align-items: baseline;
		padding: 20upx $page-row-spacing;
		line-height: 60upx;
		position: relative;
		background: #fff;
		justify-content: center;

		&.log-out-btn {
			margin-top: 40upx;

			.cell-tit {
				color: $uni-color-primary;
				text-align: center;
				margin-right: 0;
			}
		}

		&.cell-hover {
			background: #fafafa;
		}

		&.b-b:after {
			left: 30upx;
		}

		&.m-t {
			margin-top: 16upx;
		}

		.cell-more {
			align-self: baseline;
			font-size: $font-lg;
			color: $font-color-light;
			margin-left: 10upx;
		}

		.cell-tit {
			flex: 1;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			margin-right: 10upx;
		}

		.cell-tip {
			font-size: $font-base;
			color: $font-color-light;
		}

		switch {
			transform: translateX(16upx) scale(.84);
		}
	}

	/* .j_copyright{
		color: #606266;
		padding-top: 200upx;
		font-size: 20upx;
		text-align: center;
	}
	.j_copyright text{
		display: block;
		line-height: 40upx;
	} */
</style>